package com.turing.post.salesmanage.util;

import java.math.BigInteger;
import java.util.List;

import javax.ejb.Local;
import javax.ejb.Remote;

import com.turing.post.util.PCPSApplicationException;

/**
 * 销售单售卡明细
 * 
 * @author zxp
 * @Dec 23, 2012
 */
@Remote
@Local
public interface SaleOrderCardDetailDao {

	/**
	 * 根据主键查询销售单售卡明细
	 * 
	 * @param saleOrderCardDetail
	 *            销售单售卡明细
	 * @return 销售单售卡明细
	 */
	public SaleOrderCardDetail getSaleOrderCardDetailByPrimaryKey(
			SaleOrderCardDetail saleOrderCardDetail);

	/**
	 * 查询销售单下所有售卡明细
	 * 
	 * @param saleOrderId
	 *            销售单编号
	 * @return 销售单售卡明细列表
	 */
	public List<SaleOrderCardDetail> getSaleOrderCardDetailListBySaleOrderId(
			BigInteger saleOrderId);

	/**
	 * 根据条件查询销售单售卡明细记录
	 * 
	 * @param saleOrderId
	 *            销售单号
	 * @param page
	 *            页码
	 * @return 销售单售卡明细列表
	 */
	public List<SaleOrderCardDetail> getSaleOrderCardDetailListByCondition(
			BigInteger saleOrderId, Integer page);

	/**
	 * 根据条件查询销售单售卡明细记录数
	 * 
	 * @param saleOrderId
	 *            销售单号
	 * @return 记录数
	 */
	public BigInteger getSaleOrderCardDetailTotalByCondition(
			BigInteger saleOrderId);

	/**
	 * 新增
	 * 
	 * @param saleOrderCardDetail
	 * @throws PCPSApplicationException
	 */
	public void insertSaleOrderCardDetail(
			SaleOrderCardDetail saleOrderCardDetail)
			throws PCPSApplicationException;

	/**
	 * 删除
	 * 
	 * @param saleOrderCardDetail
	 * @throws PCPSApplicationException
	 */
	public Integer deleteSaleOrderCardDetail(
			SaleOrderCardDetail saleOrderCardDetail)
			throws PCPSApplicationException;

	/**
	 * 根据批次号、起始序号和终止序号得到销售明细对象
	 * 
	 * @param batchNo
	 * @param startCardSeqNo
	 * @param endCardSeqNo
	 * @return
	 */
	public SaleOrderCardDetail getSaleOrderCardDetailByBatchNo(String batchNo,
			String startCardSeqNo, String endCardSeqNo);

	/**
	 * 根据卡顺序号获取购卡人信息
	 * 
	 * @param cardSeqNo
	 * @return
	 */
	public String[] getSaleOrderByCardSeqNo(String cardSeqNo);

	/**
	 * 卡销售明细报表:根据销售单id获取销售单明细
	 * 
	 * @param saleOrderId
	 * @return
	 */
	public List<Object[]> getSaleOrderCardDetailReportBySaleOrderId(
			BigInteger saleOrderId);

}
